package com.itheima.youdianda.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data;

import java.util.Map;

/**
 * @Author Pan Rundong
 * @Date 2023-02-14 19:30
 * @Desc 设置表单
 */
@Data
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class ConfigForm {
    @JsonProperty("system_name")
    private String systemName;
    @JsonProperty("system_logo")
    private String systemLogo;
    @JsonProperty("web_ico")
    private String webIco;
    @JsonProperty("site_name")
    private String siteName;
    @JsonProperty("site_link")
    private String siteLink;
    @JsonProperty("site_keywords")
    private String siteKeyWords;
    @JsonProperty("close_website")
    private String closeWebSite;
    @JsonProperty("copy_code")
    private String copyCode;
    @JsonProperty("copy_info")
    private String copyInfo;

    private String phone;
    @JsonProperty("copy_url")
    private String copyUrl;
    @JsonProperty("black_ip")
    private String blackIp;
    @JsonProperty("login_title")
    private String loginTitle;
    @JsonProperty("login_bg")
    private String loginBg;

    public ConfigForm(Map map) {
        this.systemName = (String) map.get("system_name");
        this.systemLogo = (String) map.get("system_logo");
        this.webIco = (String) map.get("web_ico");
        this.siteName = (String) map.get("site_name");
        this.siteLink = (String) map.get("site_link");
        this.siteKeyWords = (String) map.get("site_keywords");
        this.closeWebSite = (String) map.get("close_website");
        this.copyCode = (String) map.get("copy_code");
        this.copyInfo = (String) map.get("copy_info");
        this.phone = (String) map.get("phone");
        this.copyUrl = (String) map.get("copy_url");
        this.blackIp = (String) map.get("black_ip");
        this.loginTitle = (String) map.get("login_title");
        this.loginBg = (String) map.get("login_bg");
    }
}
